package Thread;

public class Demo4 {
    public static void main(String[] args) {
        Thread t = new Thread(()-> {
            while (true){
                System.out.println("知识使用lambda表达式写的线程+hello Thread");
                try {
                    Thread.sleep(3000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        });
        t.start();
        while (true){
            System.out.println("这是主线程+hello main");
            try {
                Thread.sleep(3000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
